@extends('Admin.layout.blank')
@section('body')

<section class="Hui-article-box">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 广告管理 <span class="c-gray en">&gt;</span> 广告列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="Hui-article">
			<div class="pd-20">
				<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius" href="javascript:;" onclick="ads_add('添加广告', '{{ route('addads') }}','','510')" ><i class="Hui-iconfont">&#xe600;</i> 添加广告</a></span> <span class="r">共有数据：<strong>{{ count($adds)}}</strong> 条</span> </div>
				<div class="mt-20">
					<table class="table table-border table-bordered table-bg table-hover table-sort" >
						<thead>
							<tr class="text-c">
								<th width="40">ID</th>
								<th width="60">缩略图</th>
								<th width="60">广告名称</th>
								<th width="50">投放时间</th>
								<th width="50">结束时间</th>
								<th width="100">操作</th>
							</tr>
						</thead>
						<tbody>
							@foreach($adds as $add)
							<tr class="text-c va-m">
								<td>{{ $add->id }}</td>
								<td><img width="80" class="product-thumb" src="http://oydt3ttm3.bkt.clouddn.com/{{ $add->img }}"></td>
								<td class="text-1">{{ $add->name }}</td>
								<td class="text-1">{{ $add->startdate }}</td>
								<td class="text-1">{{ $add->enddate }}</td>
								<td class="td-manage"><a style="text-decoration:none" class="ml-5" href="javascript:;" onClick="ads_edit('广告编辑','{{ route('adsedit', ['id' => $add->id]) }}','','510')" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a title="删除" href="{{ url('Admin/ads', ['id'=> $add->id]) }}" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
							</tr>
							@endforeach
						</tbody>
					</table>
				</div>
		</div>
	</div>
</section>
@endsection

@section('footer-js')
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{{ asset('AdminPublic/lib/My97DatePicker/4.8/WdatePicker.js')}}"></script>

<script type="text/javascript" src="{{ asset('AdminPublic/lib/laypage/1.2/laypage.js')}}"></script>
<script type="text/javascript" src="{{ asset('AdminPublic/lib/zTree/v3/js/jquery.ztree.all-3.5.min.js')}}"></script>
<script type="text/javascript">


/*广告-添加*/
function ads_add(title, url, w, h){
	layer_show(title, url, w, h);
}

/*广告-编辑*/
function ads_edit(title,url, w, h){
	layer_show(title, url, w, h);
}

/*广告-删除*/
function ads_del(obj,id){
	layer.confirm('确认要删除吗？',function(index){
		$(obj).parents("tr").remove();
		layer.msg('已删除!',{icon:1,time:1000});
	});
}
</script>
<!--/请在上方写此页面业务相关的脚本-->
@endsection